<?php
		session_start(); 
 			if (!empty($_SESSION['username']) && !empty($_SESSION['password'])) { 
			include "libfunc.php";
			if($_GET['idmember']){
			$link = koneksi_db();
			$id=$_GET['idmember'];
			$sql1 = "select idmedia from member WHERE idmember='$id'";
			$hasil=mysql_query( $sql1,$link);
			$data = mysql_fetch_assoc($hasil);
			
			$link = koneksi_db();
			$sql1 = "DELETE * FROM media WHERE idmedia = ".$data['idmedia'];
			mysql_query( $sql1,$link);
			 
			$link = koneksi_db();
			$id=$_GET['idmember'];
			$sql = "DELETE FROM member WHERE idmember='$id'";
			 mysql_query( $sql,$link);
			
			 ?>
			<script language='javascript'>
			alert("Selamat data member berhasil di hapus!")
			window.location = '../member.php'
            </script>
             <?php
			}
			}else {
			echo "<script language='javascript'>window.location = '../admin/'</script>";
			}

?>
